<html>
<body>
    <img src="logo-small.png" />

    <script type="text/javascript" src="http://www.google.com/jsapi"></script>

    <script type="text/javascript">
        google.load("gdata", "1");
        function logMeIn() {
            scope = "http://www.google.com/calendar/feeds/";
            var token = google.accounts.user.login(scope);
            if(token){
		var out = document.createElement("div");
		out.innerHTML = "Token: " + token;
		document.body.appendChild(out);
            }
            return token;
        }
        function logMeOut() {
            google.accounts.user.logout();
        }
    </script>

    <input type="button" value="Login" onclick="alert(logMeIn());" />
    <input type="button" value="Logout" onclick="logMeOut()" />
</body>
</html>
